package org.vt.ece4564.pcw.assignment2data;

import java.security.MessageDigest;

public class PasswordEncrypt {
	
	public static String encrypt(String password) {
		try {
			MessageDigest sha = MessageDigest.getInstance("SHA-512");
			
			sha.update(password.getBytes("UTF-8"));
			
			byte[] byteArray = sha.digest();
			
			String encrypted = new String(byteArray);
			
			return encrypted;
		} catch (Exception e) {
			System.out.println(e.toString());
		}
		
		return "?";
	}

}
